Skip to content

⚡ Bolt: process_dir 내 정적 문자열 및 해시 연산 캐싱 최적화 - #317

Closed
seonghobae wants to merge 2 commits into
masterfrom
bolt/optimize-process-dir-16817524199184166254
Closed

⚡ Bolt: process_dir 내 정적 문자열 및 해시 연산 캐싱 최적화#317
seonghobae wants to merge 2 commits into
masterfrom
bolt/optimize-process-dir-16817524199184166254

Conversation

@seonghobae

@seonghobae seonghobae commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator
  • 💡 What: process_dir 내에 있던 큰 CSS 문자열 할당 및 SHA-256 해시 계산 코드를 private object(ProcessDirConstants)로 분리하여 한 번만 계산 및 할당되도록 최적화했습니다.
  • 🎯 Why: process_dir는 크롤링하는 각 디렉토리마다 호출됩니다. 디렉토리가 많은 경우, 동일한 정적 데이터를 반복해서 메모리에 할당하고 해시 연산을 수행하면 불필요한 성능(CPU 및 메모리) 저하가 발생하기 때문입니다.
  • 📊 Impact: 디렉토리가 많은 환경(예: 10,000개 이상)에서 불필요한 객체 생성 횟수와 해싱 연산 횟수를 1만 번 이상 줄여 전반적인 속도 향상과 가비지 컬렉션(GC) 부하 감소가 예상됩니다.
  • 🔬 Measurement: 최적화 후 ./gradlew test를 통해 기존 동작의 올바름을 검증하고, 프로파일링 시 process_dir 내 객체 할당(Allocations) 및 CPU 시간이 감소하는 것을 확인할 수 있습니다.

PR created automatically by Jules for task 16817524199184166254 started by @seonghobae

Summary by CodeRabbit

  • 성능 개선
    • 디렉터리 페이지 생성에 사용되는 정적 콘텐츠와 스타일 해시를 한 번만 초기화하도록 최적화했습니다.
    • CSS와 HTML 조각을 일관되게 공유해 페이지 생성 효율성을 개선했습니다.

`process_dir` 내에 있던 큰 CSS 문자열 할당 및 `SHA-256` 해시 계산 코드를 `private object`(`ProcessDirConstants`)로 분리하여 한 번만 계산 및 할당되도록 최적화했습니다.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c4838dd8-9543-4439-8121-65cd2f7767d2

📥 Commits

Reviewing files that changed from the base of the PR and between a32b065 and 1ea639c.

📒 Files selected for processing (2)
  • .jules/bolt.md
  • src/main/kotlin/html4tree/main.kt

📝 Walkthrough

Walkthrough

process_dir의 정적 CSS, HTML 조각, 스타일 해시를 ProcessDirConstants private object로 이동했습니다. CSP와 인덱스 파일 조립은 공유 상수를 사용합니다. 관련 최적화 지침을 추가했습니다.

Changes

process_dir 상수화

Layer / File(s) Summary
정적 값과 해시 계산 이동
.jules/bolt.md, src/main/kotlin/html4tree/main.kt
CSS, 하단 HTML 조각, SHA-256 스타일 해시를 ProcessDirConstants의 상수로 이동했습니다. 최적화 지침을 추가했습니다.
process_dir 참조 갱신
src/main/kotlin/html4tree/main.kt
CSP, 문서 본문, 인덱스 파일 조립이 공유 상수를 참조하도록 변경했습니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 process_dir의 정적 문자열과 해시 연산 캐싱이라는 주요 변경 사항을 명확하게 요약합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bolt/optimize-process-dir-16817524199184166254

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by #362. Both move the immutable CSS block and SHA-256 calculation out of process_dir; #362 is the current protected-base, private-surface implementation with successful exact-head CI, Security Scan, and Semgrep evidence. Any additional optimization should follow as a separate bounded change after #362.

@seonghobae seonghobae closed this Aug 5, 2026
@google-labs-jules

Copy link
Copy Markdown

Closing as superseded by #362. Both move the immutable CSS block and SHA-256 calculation out of process_dir; #362 is the current protected-base, private-surface implementation with successful exact-head CI, Security Scan, and Semgrep evidence. Any additional optimization should follow as a separate bounded change after #362.

Understood. Acknowledging that this work is superseded by #362 and stopping work on this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant